<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <title>title</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css"/>
    <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>

    <style>
    	body{
    		height:100%;
    		width:100%;
    	}
    	#container{
    		height:100%;
    		width:100%;
    		text-align:center;
    	}
    	.form{
    		width:90%;
    		margin-left:30px;
    		margin-top:30px;
    	}
    	p{line-height:29px;margin-top:20px;}
    	button{background-color: green;border:none;box-shadow:2px;}
    	input{border:none;border-bottom:1px solid #CDCDCD;}
    	table{width:90%}
    	tr{line-height:30px;text-align:center;}
    	td{font-size:16px;}
    	
    </style>
</head>
<body>
	<div id="container">
		<p>成功推荐一名商家下单后奖励2000元</p>
		<div class="form">
			<form>
				<table>
					<tr>
						<td>业主姓名：</td>
						<td><input type="text" name="username" id="username" /></td>
					</tr>
					<tr>
						<td>联系方式：</td>
						<td><input type="text" name="userway" id="userway" /></td>
					</tr>
					<tr>
						<td>装修地址：</td>
						<td><input type="text" name="useraddr" id="useraddr" /></td>
					</tr>
					<tr>
						<td>备注：</td>
						<td><input type="text" name="remarks" id="remarks" /></td>
					</tr>
					<tr>
						<td colspan="2">
							<button tapmode="" type="button" onclick="tuijian()" class="btn btn-positive">
                           		立即推荐
   							</button>
						</td>
					</tr>
				</table>
			</form>
		</div>
		<p>说明：被推荐业主资料我们将保密，带业主来公司洽谈同样有效</p>
		<p>24小时服务热线：1321866868</p>
	</div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript">
	apiready = function(){
		
	};
	
	function tuijian(){
			var model = api.require('model');
			var query = api.require('query');
			var username = $api.val($api.byId("username"));
			var userway = $api.val($api.byId("userway"));
			var useraddr = $api.val($api.byId("useraddr"));
			var remarks = $api.val($api.byId("remarks"));
			model.config({
        		appId:'A6983028685064',
			    appKey: '82F479F5-3EE1-DB3B-ECCF-B10EBBA37BF3',
			    host: 'https://d.apicloud.com/'
			});
			model.insert({
	            class:'info',
	            value:{
	            	username:username,
	            	userway:userway,
	            	useraddr:useraddr,
	            	remarks:remarks
	            }
	        },function(ret,err){
	        	api.alert({msg:'推荐成功'});
	        });
		}
	
	function nihao(){
			alert('你好');
		}
	
</script>

</html>